-
Notifications
You must be signed in to change notification settings - Fork 4.8k
HIVE-29383: Iceberg: [V3] Add support for timestamp with nanosecond precession #6258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
2381504 to
067bd55
Compare
067bd55 to
bd4a90f
Compare
| } else if (params != null && params.length > 1) { | ||
| throw new IllegalArgumentException( | ||
| "Timestamp takes only one parameter, but " + params.length + " is seen"); | ||
| } | ||
| return TypeInfoFactory.getTimestampTypeInfo(prec); | ||
| case TIMESTAMPLOCALTZ: | ||
| int precTimeZone = 6; | ||
| if (params != null && params.length == 1) { | ||
| precTimeZone = Integer.parseInt(params[0]); | ||
| } else if (params != null && params.length > 1) { | ||
| throw new IllegalArgumentException( | ||
| "Timestamp takes only one parameter, but " + params.length + " is seen"); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines are duplicated in 2 places in this block of code, should they be extracted into a helper method?
if (params != null && params.length > 1) {
throw new IllegalArgumentException(
"Timestamp takes only one parameter, but " + params.length + " is seen");
}
| super(serdeConstants.TIMESTAMPLOCALTZ_TYPE_NAME); | ||
| this.timeZone = TimestampTZUtil.parseTimeZone(timeZoneStr); | ||
| if (precision != 6 && precision != 9) { | ||
| throw new RuntimeException("Unsupported value for precision: " + precision); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same exception error message is reused in TimestampTypeInfo constructor, should we define a common error message in ErrorMsg for reuse?
difin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM +1
Left 2 comments about some minor code duplication.
|



What changes were proposed in this pull request?
Add support for Iceberg Nanosecond Timestamp
Why are the changes needed?
To support the new V3 Nanosecond Timestamp
Does this PR introduce any user-facing change?
yes, users can create iceberg v3 table with nanosecond timestamp precession.
How was this patch tested?
UT + Docker With Iceberg master(Which includes bug fixes for multiple issues regarding nanosecond timestamp)